<?php
/**
 * Created by PhpStorm.
 * User: peter
 * Date: 18-9-27
 * Time: 上午10:55
 */

namespace app\model;

use think\model\concern\SoftDelete;
use think\Model;

class ActivityGroupStage extends Base
{
    protected $pk = 'id';
    // 此处表名请务必设置为public
    public $table = 'activity_group_stage';
    protected $autoWriteTimestamp = true; //自动时间戳
    protected $createTime  = 'create_at';
    protected $updateTime  = 'update_at';
    // 软删除
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $defaultSoftDelete = 0;

    /**
     * @purpose 管理活动模型
     * @return \think\model\relation\HasOne
     */
    public function activity ()
    {
        return $this->hasOne('Activity', 'id', 'activity_id');
    }
    public function collectionPoint ()
    {
        return $this->hasMany('ActivityCollectionPoint', 'activity_group_stage_id', 'id');
    }
}